package com.ruoyi.sl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlApprenticeMapper;
import com.ruoyi.sl.domain.SlApprentice;
import com.ruoyi.sl.service.ISlApprenticeService;

/**
 * 学徒系数Service业务层处理
 * 
 * @author admin
 * @date 2024-06-03
 */
@Service
public class SlApprenticeServiceImpl implements ISlApprenticeService 
{
    @Autowired
    private SlApprenticeMapper slApprenticeMapper;

    /**
     * 查询学徒系数
     * 
     * @param apprenticeId 学徒系数主键
     * @return 学徒系数
     */
    @Override
    public SlApprentice selectSlApprenticeByApprenticeId(Long apprenticeId)
    {
        return slApprenticeMapper.selectSlApprenticeByApprenticeId(apprenticeId);
    }

    /**
     * 根据模块ID和级别ID查询学徒系数
     *
     * @param slApprentice 模块ID和级别ID
     * @return 学徒信息
     */
    @Override
    public SlApprentice selectSlApprenticeByModuleAndLevel(SlApprentice slApprentice){
        return slApprenticeMapper.selectSlApprenticeByModuleAndLevel(slApprentice);
    }

    /**
     * 查询学徒系数列表
     * 
     * @param slApprentice 学徒系数
     * @return 学徒系数
     */
    @Override
    public List<SlApprentice> selectSlApprenticeList(SlApprentice slApprentice)
    {
        return slApprenticeMapper.selectSlApprenticeList(slApprentice);
    }

    /**
     * 新增学徒系数
     * 
     * @param slApprentice 学徒系数
     * @return 结果
     */
    @Override
    public int insertSlApprentice(SlApprentice slApprentice)
    {
        slApprentice.setCreateTime(DateUtils.getNowDate());
        return slApprenticeMapper.insertSlApprentice(slApprentice);
    }

    /**
     * 修改学徒系数
     * 
     * @param slApprentice 学徒系数
     * @return 结果
     */
    @Override
    public int updateSlApprentice(SlApprentice slApprentice)
    {
        slApprentice.setUpdateTime(DateUtils.getNowDate());
        return slApprenticeMapper.updateSlApprentice(slApprentice);
    }

    /**
     * 批量删除学徒系数
     * 
     * @param apprenticeIds 需要删除的学徒系数主键
     * @return 结果
     */
    @Override
    public int deleteSlApprenticeByApprenticeIds(Long[] apprenticeIds)
    {
        return slApprenticeMapper.deleteSlApprenticeByApprenticeIds(apprenticeIds);
    }

    /**
     * 删除学徒系数信息
     * 
     * @param apprenticeId 学徒系数主键
     * @return 结果
     */
    @Override
    public int deleteSlApprenticeByApprenticeId(Long apprenticeId)
    {
        return slApprenticeMapper.deleteSlApprenticeByApprenticeId(apprenticeId);
    }
}
